<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
        <ui:page binding="#{departamentos.page1}" id="page1">
            <ui:html binding="#{departamentos.html1}" id="html1">
                <ui:head binding="#{departamentos.head1}" id="head1">
                    <ui:link binding="#{departamentos.link1}" id="link1" url="/resources/stylesheet.css"/>
                </ui:head>
                <ui:body binding="#{departamentos.body1}" id="body1" style="-rave-layout: grid">
                    <ui:form binding="#{departamentos.form1}" id="form1" virtualFormsConfig="VFGuardar | gridPanelContenedorGlobal:tablaDepartamentos:tableRowGroup1:tableColumn1:codigoTextField gridPanelContenedorGlobal:tablaDepartamentos:tableRowGroup1:tableColumn2:nombreTextField | gridPanelContenedorGlobal:tablaDepartamentos:tableRowGroup1:tableColumn1:codigoTextField gridPanelContenedorGlobal:groupPanelBotones:botonGuardar gridPanelContenedorGlobal:tablaDepartamentos:tableRowGroup1:tableColumn2:nombreTextField , VFOtrosBotones | | gridPanelContenedorGlobal:tablaDepartamentos:tableRowGroup1:tableColumn3:botonEliminar gridPanelContenedorGlobal:groupPanelBotones:botonCerrar gridPanelContenedorGlobal:groupPanelBotones:botonRefrescar gridPanelContenedorGlobal:groupPanelBotones:botonAgregar">
                        <h:panelGrid binding="#{departamentos.gridPanelContenedorGlobal}" id="gridPanelContenedorGlobal" style="left: 72px; top: 120px; position: absolute">
                            <h:panelGrid binding="#{departamentos.gridPanelTituloYAlert}" columns="2" id="gridPanelTituloYAlert">
                                <ui:staticText binding="#{departamentos.titulo}" id="titulo"
                                    style="color: rgb(108, 154, 154); font-family: 'Times New Roman','Times',serif; font-size: 18px" text="Departamentos"/>
                                <ui:alert binding="#{departamentos.alert1}" id="alert1"/>
                            </h:panelGrid>
                            <ui:table augmentTitle="false" binding="#{departamentos.tablaDepartamentos}" clearSortButton="true" id="tablaDepartamentos"
                                lite="true" paginateButton="true" paginationControls="true" sortPanelToggleButton="true" style="width: 240px" title="Tabla" width="240">
                                <script><![CDATA[
                                /* ----- Functions for Table Preferences Panel ----- */
                                /*
                                * Toggle the table preferences panel open or closed
                                */
                                function togglePreferencesPanel() {
                                var table = document.getElementById("form1:table1");
                                table.toggleTblePreferencesPanel();
                                }
                                /* ----- Functions for Filter Panel ----- */
                                /*
                                * Return true if the filter menu has actually changed,
                                * so the corresponding event should be allowed to continue.
                                */
                                function filterMenuChanged() {
                                var table = document.getElementById("form1:table1");
                                return table.filterMenuChanged();
                                }
                                /*
                                * Toggle the custom filter panel (if any) open or closed.
                                */
                                function toggleFilterPanel() {
                                var table = document.getElementById("form1:table1");
                                return table.toggleTableFilterPanel();
                                }
                                /* ----- Functions for Table Actions ----- */
                                /*
                                * Initialize all rows of the table when the state
                                * of selected rows changes.
                                */
                                function initAllRows() {
                                var table = document.getElementById("form1:table1");
                                table.initAllRows();
                                }
                                /*
                                * Set the selected state for the given row groups
                                * displayed in the table.  This functionality requires
                                * the 'selectId' of the tableColumn to be set.
                                *
                                * @param rowGroupId HTML element id of the tableRowGroup component
                                * @param selected Flag indicating whether components should be selected
                                */
                                function selectGroupRows(rowGroupId, selected) {
                                var table = document.getElementById("form1:table1");
                                table.selectGroupRows(rowGroupId, selected);
                                }
                                /*
                                * Disable all table actions if no rows have been selected.
                                */
                                function disableActions() {
                                // Determine whether any rows are currently selected
                                var table = document.getElementById("form1:table1");
                                var disabled = (table.getAllSelectedRowsCount() > 0) ? false : true;
                                // Set disabled state for top actions
                                document.getElementById("form1:table1:tableActionsTop:deleteTop").setDisabled(disabled);
                                // Set disabled state for bottom actions
                                document.getElementById("form1:table1:tableActionsBottom:deleteBottom").setDisabled(disabled);
                                }]]></script>
                                <ui:tableRowGroup binding="#{departamentos.tableRowGroup1}" id="tableRowGroup1" rows="20"
                                    sourceData="#{departamentos.sct0058DataProviderDepartamentos}" sourceVar="currentRow">
                                    <ui:tableColumn binding="#{departamentos.tableColumn1}" headerText="Codigo" id="tableColumn1" sort="SCT0058.CDGODPRTMNTO">
                                        <ui:textField binding="#{departamentos.codigoTextField}" columns="3"
                                            converter="#{departamentos.integerConverterParaCodigo}" id="codigoTextField" maxLength="3" required="true" text="#{currentRow.value['SCT0058.CDGODPRTMNTO']}"/>
                                        <ui:message binding="#{departamentos.message1}" for="codigoTextField" id="message1" showDetail="false" showSummary="true"/>
                                    </ui:tableColumn>
                                    <ui:tableColumn binding="#{departamentos.tableColumn2}" headerText="Nombre" id="tableColumn2" sort="SCT0058.NMBREDPRTMNTO">
                                        <ui:textField binding="#{departamentos.nombreTextField}" id="nombreTextField" maxLength="30" required="true"
                                            text="#{currentRow.value['SCT0058.NMBREDPRTMNTO']}" valueChangeListener="#{departamentos.nombreTextField_processValueChange}"/>
                                        <ui:message binding="#{departamentos.message2}" for="nombreTextField" id="message2" showDetail="false" showSummary="true"/>
                                    </ui:tableColumn>
                                    <ui:tableColumn binding="#{departamentos.tableColumn3}" id="tableColumn3">
                                        <ui:button action="#{departamentos.botonEliminar_action}" binding="#{departamentos.botonEliminar}" id="botonEliminar"
                                            mini="true" primary="true" text="Eliminar"/>
                                    </ui:tableColumn>
                                </ui:tableRowGroup>
                                <!-- Actions (Top) -->
                                <f:facet name="actionsTop">
                                    <ui:panelGroup binding="#{departamentos.groupPanelBotones}" id="groupPanelBotones">
                                        <ui:button action="#{departamentos.botonAgregar_action}" binding="#{departamentos.botonAgregar}" id="botonAgregar"
                                            mini="true" primary="true" style="width: 71px" text="Agregar"/>
                                        <ui:button action="#{departamentos.botonRefrescar_action}" binding="#{departamentos.botonRefrescar}" id="botonRefrescar"
                                            mini="true" primary="true" style="width: 71px" text="Refrescar"/>
                                        <ui:button action="#{departamentos.botonGuardar_action}" binding="#{departamentos.botonGuardar}" id="botonGuardar"
                                            mini="true" primary="true" style="width: 71px" text="Guardar"/>
                                        <ui:button action="#{departamentos.botonCerrar_action}" binding="#{departamentos.botonCerrar}" id="botonCerrar"
                                            mini="true" primary="true" style="width: 47px" text="Cerrar"/>
                                    </ui:panelGroup>
                                </f:facet>
                            </ui:table>
                        </h:panelGrid>
                        <div style="left: 0px; top: 0px; position: absolute">
                            <jsp:include page="encab1.jspf"/>
                        </div>
                    </ui:form>
                </ui:body>
            </ui:html>
        </ui:page>
    </f:view>
</jsp:root>
